import {createRouter, createWebHistory} from 'vue-router';
import HomeView from '../views/HomeView.vue';
import LoginView from '../views/LoginView.vue';
import InstanceDetail from '../views/InstanceDetail.vue';

const routes = [
    {
        path: '/login',
        name: 'LoginView',
        component: LoginView,
    },
    {
        path: '/',
        name: 'LayoutView',
        component: () => import('../components/LayoutView.vue'), // 导入布局页组件
        children: [
            // 在这里配置Layout页面的子路由
            // 例如：
            {
                path: 'home',
                component: HomeView
            },
            // 在这里配置Layout页面的子路由
            // 例如：
            {
                path: 'instanceDetail',
                component: InstanceDetail
            }
        ],
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
